<template>
  <div class="orders-information" v-if="list">
    <div class="information">
      <div class="information-1">
        <van-icon name="shop-o" />
        <span class="information-1-1">{{ renderlist.name }}</span>
      </div>

      <div class="information-2">
        <van-swipe-cell>
          <van-card
            num="1"
            :price="renderlist.price"
            :desc="renderlist.ext.icon[0].desc"
            :title="renderlist.name"
            class="goods-card"
            :thumb="imgSrc"
            disabled="true"
          />
        </van-swipe-cell>

        <div class="y1">
          <div class="y1-1">配送</div>
          <div class="y1-2-box">
            <div class="y1-2-box-1">快递运输</div>
            <div class="y1-2-box-2">预计3月10日前发货，3月11日24:00前送达</div>
          </div>
          <van-icon name="arrow" size="10px" />
        </div>
      </div>

      <div class="information-3">
        <div class="information-3-1">留言</div>
        <div class="information-3-2">建议留言前先与商家沟通确认</div>
      </div>
    </div>
  </div>
</template>

<script lang="ts" setup>
import router from '@/router'
import { useCarStore } from '@/stores/car'
import { useContentStore } from '@/stores/content'

//图片
const imgSrc = computed(() => {
  return renderlist.value.imgprefix + renderlist.value.imgbase
})

//props
const props = defineProps(['list'])

//拿出数据
const renderlist = computed(() => {
  try {
    if (props.list) {
    return props.list
  }
  return
  } catch (error) {
    return  props.list 
  }
})

// setTimeout(() => {
//   // console.log(renderlist.value);
//   console.log(renderlist.value)
// }, 400)
</script>

<style scoped>
.van-icon {
  margin-top: 3px;
}
::v-deep(.van-card__price) {
  color: red;
  display: inline;
}
::v-deep(.van-card__price-integer) {
  font-size: 20px;
}

.orders-information {
  width: 100%;
  height: 260px;
  background-color: #fff;
  border-radius: 10px;
  margin-top: 12px;
  padding: 6px 12px;
  box-sizing: border-box;
}
.information {
  width: 100%;
  height: 100%;

  display: block;
}
.information-1 {
  width: 100%;
  height: 30px;
  /* background-color: red; */
  font-size: 14px;
  line-height: 30px;
  text-overflow: ellipsis;
  overflow: hidden;
  word-break: break-all;
  white-space: nowrap;
}
.information-1-1 {
  margin-left: 6px;
}
.information-2 {
  width: 100%;
  height: 184px;
  padding: 16px 0;
  box-sizing: border-box;
}
.y1 {
  width: 100%;
  height: 44px;
  margin-top: 12px;
  display: flex;
}
.y1-1 {
  height: 100%;
  width: 32px;
  font-size: 14px;
  margin-left: 12px;
}
.y1-2-box {
  font-size: 14px;
}
.y1-2-box-1 {
  float: right;
  margin-right: 4px;
  margin-bottom: 5px;
}
.y1-2-box-2 {
  float: right;
  margin-right: 4px;
}
.information-3 {
  width: 100%;
  height: 22px;
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
  font-size: 14px;
  line-height: 22px;
}
.information-3-1 {
  margin-left: 12px;
}
.information-3-2 {
  color: #757575;
}
</style>
